var reverseList = function (head) {
  if (!head) return head
  let pre = null
  let cur = head
  let next = cur.next

  while (cur) {
    cur.next = pre
    pre = cur
    cur = next
    if (next) {
      next = next.next
    }
  }
  return pre
};